public class Course {
    private final String courseId;    // 课程编号
    private final String courseName;  // 课程名称
    private final String location;    // 上课地点
    private final String time;        // 上课时间
    private Teacher teacher;    // 授课教师

    // 构造方法
    public Course(String courseId, String courseName, String location, String time) {
        this.courseId = courseId;
        this.courseName = courseName;
        this.location = location;
        this.time = time;
    }

    // getter和setter方法
    public String getCourseId() {
        return courseId;
    }

    public String getCourseName() {
        return courseName;
    }

    public String getLocation() {
        return location;
    }

    public String getTime() {
        return time;
    }

    public Teacher getTeacher() {
        return teacher;
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }

    @Override
    public String toString() {
        return "课程编号: " + courseId +
                ", 课程名称: " + courseName +
                ", 上课地点: " + location +
                ", 上课时间: " + time +
                ", 授课教师: " + (teacher != null ? teacher.getName() : "未安排");
    }
}
